package bom.example.common.utils;

import java.io.File;

/**
 * @author X.I.O
 * @title: PathUtils
 * @projectName springboot
 * @description: TODO
 * @date 2021/10/26 15:13
 */
public class PathUtils {

    public static String getPath(){
        return System.getProperty("user.dir");
    }

    public static File getPathByName(String dictory, String path){
        String p=getPath();
        File file=new File(p+File.separator+dictory);
        if(!file.exists()){
            file.mkdirs();
        }
        return new File(file.getPath()+File.separator+path);
    }



    public static File getPathByName(String path){
        String p=getPath();
        File file=new File(p+File.separator+path);
        if(!file.exists()){
            file.mkdirs();
        }
        return file;
    }
}
